package com.weixin.engine.models.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.weixin.common.utils.MyEncryptTypeHandler;
import lombok.*;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author wangchunhui
 * @since 2023-02-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "m_region", autoResultMap = true)
public class Region implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    /**
     * 行政区划代码
     */
    private String code;

    /**
     * 名称
     */
    @TableField(value = "name", typeHandler = MyEncryptTypeHandler.class)
    private String name;

    /**
     * 上级id
     */
    private Long pid;

    /**
     * 层级 0 全国 1省 2市 3区
     */
    private Integer levelId;

    public Region(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
